Skip to content

fix(secrets): redact short unquoted credential assignments - #195

Merged
himanshu748 merged 4 commits into
himanshu748:mainfrom
jdotc1:fix-short-unquoted-secret-assignments-20261121
Nov 22, 2026
Merged

himanshu748 merged 4 commits into
himanshu748:mainfrom
jdotc1:fix-short-unquoted-secret-assignments-20261121

Conversation

@jdotc1

@jdotc1 jdotc1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Security defect

secret_assignment required at least eight characters for unquoted credentials. A valid short password or token (DB_PASSWORD=12, client_secret=0) could reach the trusted memory context unredacted. Quoted values already had different handling.

Fix

  • Remove the unquoted-value length threshold for explicitly named credential assignments; unlike anonymous tokens, these have a high-confidence key name.
  • Limit separator whitespace to spaces and tabs so empty assignments cannot consume the next line (LF or CRLF), while retaining short unquoted credential matching.
  • Add regression tests for 1–7 character values, full redaction, adjacent non-secret identifiers, LF/CRLF empty assignments followed by ordinary text, and short values with preserved line boundaries.

Verification

Added test_unquoted_short_secret_assignments_are_not_leaked, test_empty_unquoted_secret_assignments_preserve_following_line, and test_short_unquoted_secret_assignments_preserve_following_line.

Focused regex checks passed for LF, CRLF, and short credential values. GitHub Actions CI #244 passed, including backend tests (Python 3.12), frontend lint, typecheck, and build. Vercel deployment remains blocked pending repository-team authorization for the external contributor; this is not a code-test failure.

@vercel

vercel Bot commented Nov 22, 2026

Copy link
Copy Markdown

@jdotc1 is attempting to deploy a commit to the himanshu's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7e9e6a68-ed1c-4050-bb98-843b65bc9ed4
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@himanshu748 himanshu748 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep unquoted credential assignments on a single line. The whitespace around the separator currently includes line breaks, so lowering the length threshold can make an empty assignment consume a short value from the next line. Add LF and CRLF tests for an empty assignment followed by ordinary text, alongside the short-password cases.

jdotc1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor Author

@himanshu748 Addressed the requested review changes in commits c9146cd and 56a82fa.

  • Replaced the separator-side \s* with [ \t]*, restricting both = and : assignments to one line without reinstating the 8-character minimum.
  • Added LF/CRLF regression tests for empty credential assignments followed by ordinary text, short nonempty credentials with preserved following lines, and consecutive short assignments.
  • Focused regex checks passed. CI #244 passed (Python 3.12 backend unit tests; frontend lint, typecheck, and build).

The Vercel check separately reports that external-contributor deployment requires authorization from your Vercel team; it does not report a code-test failure.

@himanshu748
himanshu748 merged commit 7c3b24d into himanshu748:main Nov 22, 2026
6 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants